<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript">
			function copyContent() {
				var contetn = "";
				const textarea = document.createElement('textarea')
				for(var i = 0;i<3;i++){
					
					var name = '姓名：' + "你好" + " \n";
					var detail = '详细地址：' + "你好" + " \n";
					var city = '城市：' +"你好" + " \n";
					var postcode = '邮编：' + "你好" + " \n";
					var country = '国家：United Kingdom' + " \n";
					var telephone = '电话：' + "你好"+ " \n";
					var content = name.concat(detail, city, postcode, country, telephone);
					
					// 使用textarea支持换行，使用input不支持换行
					contetn = contetn + (content + "\n\n")
				}
				
				textarea.value = contetn;
				document.body.appendChild(textarea);
				textarea.select();
				if (document.execCommand('copy')) {
					alert("复制成功s");
				}
				document.body.removeChild(textarea);
				
			}
		</script>

	</head>
	<body>

		<!-- <div cols="20" id="biao1">
			<p>sdafsdafsdafds</p>
			<p>sdafsdafasd232332</p>
		</div> -->

		<input type="button" onClick="copyContent()" value="点击复制代码dao" />
	</body>
</html>
